<!-- 登录注册 -->

{include file="head" /}
  <style>
  /*登录注册*/
.login {
  height: auto;
  margin: 30px auto;
  width: 90%;
}

.login .l_tit {
  height: 45px;
  line-height: 45px;
  border-bottom: 2px solid #fff;
  margin: 5px auto 30px;
  width: 100%;
  box-sizing: unset;
}

.login .l_tit li {
  width: 50%;
  float: left;
  font-size: 18px;
  color: #fff;
  text-align: center;
  transition: all .2s linear;
}

.login .l_tit li.curt {
  border-bottom: 2px solid #eb8327;
  color: #eb8327;
}

.login_box {
  display: none;
}

.lg_show {
  display: block;
}

.login .l_input {
  line-height: 34px;
  background: none;
  margin-bottom: 12px;
  color: #fff;
  font-size: 14px;
  width: 100%;
  text-indent: 10px;
  border: none;
  border-bottom: 1px solid #054060;
  outline: none;
}


.login .l_btn {
  width: 100%;
  height: 50px;
  background: #eb8327;
  margin: 35px auto 20px;
  border-radius: 2px;
}

.login .l_btn .sub {
  line-height: 50px;
  color: #fff;
  background: none;
  width: 100%;
  border: none;
  font-size: 18px;
  height: 50px;
  cursor: pointer;
  outline: none;
  border-radius: 2px;
}

.login .input_bg {
  height: 34px;
  background: none;
  margin-bottom: 14px;
  border: none;
  width: 100%;
  border-bottom: 1px solid #054060;
}

.login .input_bg .verify-code {
  width: 70%;
  line-height: 34px;
  background: none;
  color: #fff;
  font-size: 14px;
  text-indent: 10px;
  border: none;
  float: left;
  border: none;
  outline: none;
}

.login .get-verify {
  width: 30%;
  float: left;
  line-height: 30px;
  text-align: center;
  background: #00a0e9;
  font-size: 16px;
  color: #fff;
  cursor: pointer;
  border: none;
  border-radius: 2px;
}

.login .checkbox {
  position: relative;
  display: block;
  margin-top: 10px;
  margin-bottom: 10px;
  color: #fff;
  font-size: 12px;
}

.checkbox label {
  min-height: 20px;
  padding-right: 20px;
  margin-bottom: 0;
  display: inline-block;
  max-width: 100%;
}

.login .checkbox input {
  width: auto;
  height: auto;
  background: #151514;
  margin: 2px 10px 0 0;
  position: absolute;
  padding-right: 20px;
  -webkit-appearance: checkbox;
}

.login .checkbox span {
  margin-left: 20px;
}
  </style>

 
  <body>
    <div class="login">
      <ul id="l_tit" class="l_tit">
          <li class="curt">登录</li>
          <li>注册</li>
      </ul>

      <ul id="l_cont">
        <li class="login_box lg_show">
          <form action="" name="formid" id="formid" method="post">
            <input type="text" class="l_input" name="username" required="" placeholder="用户名">

            <input type="password" class="l_input" name="upwd" required="" placeholder="密码">

            <div class="l_btn">
              <button type="button" name="submit" class="sub" onclick="return loginform(this.form);">登录</button>
            </div>
          </form>

        </li>
        
        <li class="login_box">
          <form name="formidregis" id="formidregis" method="post">
            <input type="text" class="l_input" name="nickname" required="" placeholder="姓名">
            
            <input type="text" class="l_input username"  name="username" required="" placeholder="手机号码">
                      
            <div class="input_bg">
              <input type="text" name="phonecode" placeholder="短信验证码" class="verify-code" id="vertify">
                  
              <input type="button" onclick ="return get_svg();" value="获取验证码" id="code_btn" class="get-verify">
            </div>

            <input type="password" name="upwd" required="" class="l_input" placeholder="密码">
        
            <input type="password" name="upwd2" required="" data-password="password" class="l_input" placeholder="确认密码">

            <input type="text" class="l_input" name="oid" required="" {if $oid} value="{$oid}" readonly="readonly" {/if}  placeholder="推荐码">


          <div class="checkbox">
            <label>
              <input type="checkbox" id="terms">
              <span>我已阅读并同意《ccoptions》<a href="/" target="_blank">条款规则</a> 等投资协议
              </span>
            </label>
          </div>
          
          <div class="l_btn">
            <button type="button" class="sub" onclick="return registerform(this.form);">注册登录</button>
          </div>
          </form>
        </li>
      </ul>
    </div>
    <script src="/static/layer/layer.js"></script>
    <!-- 公共函数 -->
    <script src="/static/public/js/function.js"></script>
    <script src="/static/public/js/base64.js"></script>
    <script type="text/javascript">
        var Base64 = new Base64();


    </script>
    <script src="__HOME__/js/lk/user.js"></script>
    <script>
      $(document).ready(function(){
        
        var url=location.href;
        var i=url.indexOf("?") 
        var parm=url.substr(i+6);
        if(parm==='register'){
          tabFun(1);
        }

        $('#l_tit li').click(function(){
          var cur=$(this).index(); //获取当前点击tab标题的索引值
          tabFun(cur);//调用方法
        });
      });

      function  tabFun(cur){
        $('#l_tit li').eq(cur).addClass('curt').siblings().removeClass('curt');
        $('#l_cont li').eq(cur).addClass('lg_show').siblings().removeClass('lg_show');
      }

      function loginform(form){
        var username = form.username.value;
        var upwd = form.upwd.value;
        
        if(!username){
          layer.msg('请输入用户名');
          return false; 
        }

        if (!upwd) {
          layer.msg('请输入密码'); 
          return false;
        }

      
        var data = $('#formid').serialize();
        var formurl = "{:Url('login/login')}";
        var locurl = "{:Url('/index/index/index/token/'.$token)}";

        WPpost(formurl,data,locurl);
        return false;
      }


      function registerform(form){
        var username = form.username.value;
        var upwd = form.upwd.value;
        var upwd2 = form.upwd2.value;
        var oid = form.oid.value;

        if(!$("#terms").is(':checked')){
          layer.msg('注册必须阅读并同意相关协议');
          vertify.focus();
          return false;
        }

        if(!username){
          layer.msg('请输入手机号');
          return false; 
        }

        if (!upwd) {
          layer.msg('请输入登录密码'); 
          return false;
        }

        if (!upwd2) {
          layer.msg('请再次输入登录密码'); 
          return false;
        }

        if(upwd.length < 6 || upwd2.length < 6){
          layer.msg('密码长度大于6位'); 
          return false;
        }

        if(upwd != upwd2){
          layer.msg('两次输入密码不同'); 
          return false;
        }

        if(!oid){
          layer.msg('请输入邀请码');
          return false; 
        }


        var data = $('#formidregis').serialize();
        var formurl = "{:Url('login/register')}";
        var locurl = "{:Url('index/index')}";

        WPpost(formurl,data,locurl);
        return false;
      }
    </script>


    

    <!-- 版权 -->
    <div class="copyright">
      <p>在线咨询：09:00——20:00 电话咨询：（香港）+852-64322383&nbsp; （英国）0-800-088-5535 <br><br>Copyright © 2008-2019 OPTIONCC 中文官网</p>
    </div>
  </body>



